package com.pig4cloud.pigx.shop.user.api.feign;

import com.pig4cloud.pigx.common.core.constant.SecurityConstants;
import com.pig4cloud.pigx.common.core.constant.ServiceNameConstants;
import com.pig4cloud.pigx.common.core.util.R;
import com.pig4cloud.pigx.shop.user.api.entity.ShopUser;
import com.pig4cloud.pigx.shop.user.api.vo.ShopUserVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;

@FeignClient(contextId = "remoteShopUserService", value = ServiceNameConstants.SHOP_USER_SERVICE)
public interface RemoteShopUserService {

	/**
	 * 通过用户名查询用户、角色信息
	 * @param loginAccount 用户名
	 * @param from 调用标志
	 * @return R
	 */
	@GetMapping("/user/shop_user_info/{loginAccount}")
	R<ShopUser> getShopUserInfo(@PathVariable("loginAccount") String loginAccount,
			@RequestHeader(SecurityConstants.FROM) String from);

	/**
	 * 通过用户名查询用户、角色信息
	 * @param from 调用标志
	 * @return R
	 */
	@GetMapping("/user/info/inner/{shopUserId}")
	R<ShopUserVO> getShopUserInfoInner(@PathVariable("shopUserId") Long shopUserId,
			@RequestHeader(SecurityConstants.FROM) String from);

}
